function bindEvents(bindings) {
    for (var i in bindings) {
        if (bindings[i].selector) {
            $$(bindings[i].element).on(bindings[i].event, bindings[i].selector, bindings[i].handler);
        } else {
            $$(bindings[i].element).on(bindings[i].event, bindings[i].handler);
        }
    }
}

var mainView = myApp.addView('.view-main');

var search = {
    count: 10,
    counts: false,
    timer: null,
    initialize: function () {
        this.bindEvent()
        this.init()
    },
    init: function () {
        var list = ['奧迪', '阿斯頓馬丁', '奔馳', '大眾', '寶馬', '法拉利', '保時捷']

        var output = tplManager.renderTplById('tplBrand', list);
        $$('.brand-item').html(output);
    },
    bindEvent: function () {
        var bindings = [
            {
                'element': '.page',
                'event': 'click',
                'selector': '.brand-li',
                'handler': this.handlerBrand()
            }
        ];
        utils.bindEvent(bindings);
    },
    handlerBrand: function () {
        return function () {
            console.log($(this).data('brand'))
            mainView.router.back({
                url: 'bound.html',
                force: true,
                ignoreCache: true,
                context: {
                    brand: $(this).data('brand')
                },
                query: {
                    brand: $(this).data('brand')
                }
            })
        }
    }
}
// bound.initialize()